﻿#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
//结构体数组
struct info_person
{
	char name[21];
	int age;
	char sex;
	double weight;
	bool hello;
};
int main()
{
	info_person persons[3];
	memset(persons, 0, sizeof(persons));
	strcpy((persons + 0)->name, "三儿"); (persons + 0)->age = 14; persons[0].sex = 'Y'; persons[0].weight = 35.6; persons[0].hello = false;
	persons[1] = { "张三",33,'X',88.3,true };
	*(persons + 2) = { "三毛",38,'X',78.4,true };

	for (int i = 0; i <3; i++)
	{
		cout<< "姓名：" << (persons + i)->name << "、年龄：" << persons[i].age << "、性别：" << persons[i].sex
			<< "、体重：" << persons[i].weight << "、咋样：" << persons[i].hello << endl;
	}
}

